From: Carlos Garnacho Date: Sat, 31 May 2025 11:24:33 +0000 (+0200) Subject: keyboard: Add purpose hint getter to KeyboardController X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~76 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d22f90bd2dd45858b2b077f995d8b21b3e867fda;p=gnome-shell.git keyboard: Add purpose hint getter to KeyboardController This is the interface between the Keyboard widgetry and the input method, add a getter so we can ask for the current purpose hint, and initialize it from the current IM state in the constructor so we can query it right away. Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 08346d353..fc21011d3 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1994,6 +1994,7 @@ class KeyboardController extends Signals.EventEmitter { 'current-source-changed', this._onSourceChanged.bind(this), 'sources-changed', this._onSourcesModified.bind(this), this); this._currentSource = this._inputSourceManager.currentSource; + this._purpose = Main.inputMethod.contentPurpose; Main.inputMethod.connectObject( 'notify::content-purpose', this._onPurposeHintsChanged.bind(this), @@ -2001,6 +2002,10 @@ class KeyboardController extends Signals.EventEmitter { 'input-panel-state', (o, state) => this.emit('panel-state', state), this); } + get purpose() { + return this._purpose; + } + destroy() { this._inputSourceManager.disconnectObject(this); Main.inputMethod.disconnectObject(this);